//
//  Util.m
//  CPU_Utility
//
//  Created by leonardo on 15/10/13.
//  Copyright © 2015年 leonardo. All rights reserved.
//

#import "Util.h"


@implementation Util
+(void)showAlert:(NSString *) msg withVC:(UIViewController*)vc{
    UIAlertController * ac = [UIAlertController alertControllerWithTitle:@"注意" message:msg preferredStyle:UIAlertControllerStyleAlert];
    UIAlertAction * action = [UIAlertAction actionWithTitle:@"是" style:UIAlertActionStyleDefault handler:nil];
    [ac addAction:action];
    
    [vc presentViewController:ac animated:YES completion:nil];
}

+(AFHTTPRequestOperationManager*)getAFNetworkingManager{
    AFHTTPRequestOperationManager * manager = [AFHTTPRequestOperationManager manager];
    manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/html",@"text/plain",@"application/json", nil];
    manager.requestSerializer.timeoutInterval = 5;
    return manager;
    
}
@end
